﻿using System.Linq;
using PSE.Deployment.Engine.Interfaces;
using PSE.Deployment.SetupBase;
using PSE.Deployment.SetupBase.Configuration;
using PSE.Deployment.SetupBase.Groups;
using PSE.Deployment.Util;
using Sinacor.Deployment.Setup.Main;

namespace Sinacor.Deployment.Setup.Install
{
    public class SinacorUpdate : SetupUpdate
    {
        public SinacorUpdate(IStepGroup parent)
            : base(parent)
        {
            this.Id = "SinacorUpdate";
            this.Description = "Alteração do Sinacor";
        }

        protected override void AddPosStepsExecution()
        {
            AddUpdateVersionStep();

            base.AddPosStepsExecution();
        }

        private void AddUpdateVersionStep()
        {
            SetupGroup setupGroup = new SetupGroup(this, new Group() { Id = "UpdateVersion", Description = "Atualização das versões" });

            setupGroup.Steps.Add(new Sinacor.Deployment.Setup.Install.Steps.UpdateInterfaceLayerVersion(setupGroup));

            this.Steps.Add(setupGroup);
        }
    }
}